package com.pucheng.bracelet.viewmodel

import com.clj.fastble.exception.BleException
import com.pucheng.bracelet.app.ble.BleCmd
import com.pucheng.bracelet.app.ble.BleWriteAndNotifyCallback
import com.pucheng.bracelet.app.ble.ClientManager
import com.pucheng.bracelet.app.util.ByteUtils
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel

class FlagViewModel : BaseViewModel(){
    fun setStepsFlag(num:Int){
        ClientManager.getInstance().sendControlCmd(BleCmd.SET_STEPS_FLAG+ByteUtils.intToHexByLength2(num,4),object : BleWriteAndNotifyCallback(){
            override fun onCharacteristicChanged(data: ByteArray?) {

            }

            override fun onWriteSuccess(current: Int, total: Int, justWrite: ByteArray?) {
            }

            override fun onWriteFailure(exception: BleException?) {
            }
        })
    }
}